package engine;

import java.util.ArrayList;
import java.util.List;

public class Population {

    private ArrayList<Candidate> candidates = new ArrayList<Candidate>();
    
    public Population(){
        
    }
    
    public void addCandidate(Candidate c){
        this.candidates.add(c);
    }
    
    public Population(ArrayList<Candidate> _candidates) {
        this.candidates = _candidates;
    }

    public ArrayList<Candidate> getCandidates() {
        return candidates;
    }

    public void setCandidates(ArrayList<Candidate> candidates) {
        this.candidates = candidates;
    }
    
    public Integer size(){
        return this.candidates.size();
    }

    @Override
    public String toString() {
        String toPrint = "";
        
        for(Candidate c : candidates)
            toPrint += c.toString() + "\n";
        
        return toPrint;
    }
    
    public void setCandidate(int index, Candidate c){
        candidates.set(index, c);
    }
    
}
